home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / comm / comm1 / cnet_bak.lha / cnetamigabackup / CNetBackUp next >
Text File  |  1997-01-15  |  25KB  |  349 lines

  1. /**************************************************************************\
  2.     $VER: CNet Amiga BackUp, v3.00 (15-Jan-97) by Dotoran of Frontiers!
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. ver=word(sourceline(2),5);a=word(sourceline(2),6);parse var a "("vdate")"
  6. tr=transmit;se=sendstring;gc=getchar;gu=getuser;gs=getscratch;mg=maygetchar
  7. a="rexxsupport.library";if ~show("l",a) then if ~addlib(a,0,-30) then exit
  8.  
  9. BEGIN:;changewhere "CNet BackUp";gu 1311992;df=result;bdf=df"BackUp/"
  10. gu 1100454;more=result;setobject 0;putuser 1100454;qa=0
  11. fn=df"CNetBackUp.";cfg=fn"CFG";files=0;total=0;fn.="";tim=date(s)
  12. if ~exists(cfg) then do;call FLOPPY
  13.   tr "n1cb`ca"df"CNetBackUp.CFGcb' c6File c9Not c6Found!"
  14.   tr "n1c7...cdtap any keyc7...g1";end;else call READCONFIG
  15. MENU:;tr "f1n1z4cer1     CNet Amiga BackUp, "ver"     r0z0n1"
  16.   tr "    cf<cdEcf> cdEdit File Parameters";tr "    cf<cbMcf> cbModify File Lists"
  17.   tr "    cf<cdAcf> cdAdd  a BackUp File";tr "    cf<cbKcf> cbKill a BackUp File"
  18.   tr "    cf<cdLcf> cdLog Viewer";tr "    cf<cbCcf> cbCreate Archive"
  19.   tr "    cf<cdFcf> cdFloppy Drives cf(cd"drives"cf)";tr "    cf<cbBcf> cbBackUp CNet Now"
  20.   tr "    ca[cdQca] cdQuit CNet BackUpn1";se "z4cer1 Command r0z0cf: "
  21. MENU0:;gc;a=result;if a=d2c(13) then a="Q";if index("EMAKLCFBQ",a)=0 then signal MENU0
  22.   if a="E" then do;tr "cdEdit Parameters";call PICK("Edit");tr "f1";signal EDITPAR;end
  23.   if a="M" then do;tr "cbModify Lists";call PICK("Use");tr "f1";signal EDITCON;end
  24.   if a="A" then do;tr "cdAdd  Filef1";signal ADDFILE;end;if a="K" then do;tr "cbKill File";signal KILLFILE;end
  25.   if a="L" then do;tr "cdLog Viewer";call PICK("Read Log of");signal LOGVIEW;end
  26.   if a="C" then do;tr "cbCreate Archive";signal CREATEARC;end
  27.   if a="F" then do;tr "cdFloppy Drives";call FLOPPY;signal MENU;end;if a="B" then do;tr "cbBackUp Now";signal BACKUP;end
  28.   if a="Q" then do;tr "cdQuit Now";signal QUITBYE;end
  29. PICK:;parse arg text;if files=0 then do;tr "f1";signal ADDFILE;end
  30.   tr "f1n1z4cer1 BackUp Files z0r0n2ce[cd1ce] cd"nam.1
  31.   do i=2 to files;co="d";if i/2=i%2 then co="b";tr "cf<c"co||i"cf> c"co||nam.i;end i
  32.   se "n1cf<c9Qcf> c9Quitn2z4cer1 "text" Which z0r0cf: "
  33. PICK0:;gc;a=result;if a="Q"|a=""|datatype(a,"n")=0|a<1|a>files then do;tr "c9Quit";signal MENU;end
  34.   file=a;co="d";if a/2=a%2 then co="b";tr "c"co||nam.a;lo=1;hi=15;save=0;return
  35.  
  36. EDITPAR:
  37.   se "f0z4cer1 Edit File Parameters z0r0cf: c6Last cb`caCNetBackUp."
  38.   se ext.file"cb' c6was c9";d=tim.file
  39.   se left(date("w",d,"s"),3)"., "date("m",d,"s")" "strip(substr(d,7,2),"l","0");tr ", "left(d,4)"c6.n1"
  40.   tr "cf<cdEcf> cd    File Extensioncf: z0car1"left(ext.file,3)"r0"
  41.   tr "cf<cbBcf> cbBackUp Descriptioncf: z0car1"left(nam.file,50)"r0"
  42.   tr "cf<cdTcf> cd    TEMP/WORK Pathcf: z0car1"left(tem.file,50)"r0"
  43.   tr "cf<cbDcf> cb  DESTINATION Pathcf: z0car1"left(des.file,50)"r0"
  44.   tr "cf<cdIcf> cd  Interval in Dayscf: z0car1"left(day.file,3)"r0"
  45.   tr "cf<cbCcf> cbCreate Directoriescf: z0car1"left(word("No Yes",(dir.file)+1),3)"r0"
  46.   tr "cf<cdAcf> cdArc to Destinationcf: z0car1"left(word("No Yes",(bac.file)+1),3)"r0"
  47.   tr "cf<cbFcf> cb  Format Dest Pathcf: z0car1"left(word("No Yes/Full Yes/Quick",(for.file)+1),9)"r0"
  48.   tr "cf<cdLcf> cd  Last BackUp Datecf: z0car1"left(tim.file,8)"r0n1"
  49.   tr "cf<cbScf> cbSave This BackUp File!";tr "ce[cdQce] cdQuit / Check For Save!"
  50. EDITPAR0:
  51.   se "6Hz4cer1 Which Parameter z0r0cf: ";gc;a=result
  52.   if a=d2c(13) then a="Q";if index("EBTDICAFLSQ",a)=0 then signal EDITPAR0
  53.   if a="E" then do;tr "cdExtension";signal EXT;end;if a="B" then do;tr "cbBackUp Name";signal NAM;end
  54.   if a="T" then do;tr "cdTemp/Work Path";signal TEM;end;if a="D" then do;tr "cbDestination Path";signal DES;end
  55.   if a="I" then do;tr "cdInterval Days";signal DAY;end
  56.   if a="C" then do;tr "cdCreate Directories";signal DIR;end;if a="A" then do;tr "cbArc to Destination";signal BAC;end
  57.   if a="F" then do;tr "cdFormat";signal FOR;end;if a="L" then do;tr "cbLast Date";signal DAT;end
  58.   if a="S" then do;tr "cdSave";signal SAV;end;if a="Q" then do;tr "cbQuit";signal QUI;end
  59. EXT:;addkeys (ext.file);tr "5Hz0car1i"1+4096" 3}r0";gu 70;a=result
  60.   bad=0;if a="" | a="CFG" then bad=1;do i=1 to files;if ext.i=a & a~=ext.file then bad=1;end i
  61.   if bad=1 then do;a=ext.file;tr "9Hc9Invalid, reserved, or already used! cf<cdKeycf>g19H";signal EDITPAR;end
  62.   if exists(df"CNetBackUp."ext.file) then do;address command 'RENAME "'df'CNetBackUp.'ext.file'" "'df'CNetBackUp.'a'"'
  63.     end;if a~=ext.file then save=1;ext.file=a;signal EDITPAR
  64. NAM:;addkeys (nam.file);tr "5Hz0car1i"16+4096" 50}r0";gu 70;a=result
  65.   if a="" then a=nam.file;if a~=nam.file then save=1;tr "5Hcar1"a"r0";nam.file=a;signal EDITPAR0
  66. TEM:;addkeys (tem.file);tr "5Hz0car1i"4096" 50}r0";gu 70;a=result
  67.   if a="" & exists(bdf) then a=bdf;b=right(a,1);if b~=":" & b~="/" then a=a"/"
  68.   if word(statef(a),1)~="DIR" then do;a=tem.file;tr "9Hc9Invalid, or nonexistent directory! cf<cdKeycf>g19H"
  69.     signal EDITPAR;end;else tr "5Hcar1"a"r0";if a~=tem.file then save=1;tem.file=a;signal EDITPAR0
  70. DES:;addkeys (des.file);se "9HcaIf a FLOPPY drive, place diskette IN the drive..."
  71.   tr "5Hz0car1i"4096" 50}r0";gu 70;a=result
  72.   if a="" then a=des.file;b=right(a,1);if b~=":" & b~="/" then a=a"/";z=pragma("w","n")
  73.   if word(statef(a),1)~="DIR" then do;a=des.file;tr "9Hc9Invalid, or nonexistent directory! cf<cdKeycf>g19H"
  74.     signal EDITPAR;end;else tr "5Hcar1"a"r09H";if a~=des.file then save=1;des.file=a;z=pragma("w")
  75.   if index(drives,a)=0 then do;for.file=0;signal EDITPAR;end;signal EDITPAR0
  76. DAY:;addkeys (day.file);tr "5Hz0car1i"64+4096" 3}r0";gu 70;a=result
  77.   if a="" then a=day.file;if a<1 | a>365 then do;a=day.file;tr "9Hc9Interval MUST be between 1 and 365 Days! cf<cdKeycf>g19H"
  78.     signal EDITPAR;end;if a~=day.file then save=1;day.file=a;tr "5Hcar1"a"r0";signal EDITPAR0
  79. DIR:;dir.file=~dir.file;save=1
  80.   tr "5Hcar1"left(word("No Yes",(dir.file)+1),3)"r0";signal EDITPAR0
  81. BAC:;bac.file=~bac.file;save=1;if bac.file=1 then for.file=0;signal EDITPAR
  82. FOR:;if index(" "drives" "," "upper(des.file)" ")=0 then do
  83.   tr "35Hc9Only when cf<cbDcf> c9is a Floppy Drive! cf<cdKeycf>g135H";signal EDITPAR;end
  84.   for.file=for.file+1;if for.file>2 then for.file=0;save=1;signal EDITPAR
  85. DAT:;addkeys (tim.file);tr "25Hz0car1i"64+4096" 8}r0";gu 70;a=result;if a="" then a=date("s");if a<19940101 | a>19991231 then do;a=tim.file
  86.   tr "34Hc9Dates Between 1/1/94 & 12/31/99! cf<cdKeycf>g134H"
  87.   signal EDITPAR;end;if a~=tim.file then save=1;tim.file=a;tr "25Hcar1"a"r0";signal EDITPAR
  88. SAV:;if save=0 then signal QUI;else do i=1 to files;file.i=tim.i"|"ext.i"|"nam.i"|"tem.i"|"des.i"|"day.i"|"dir.i"|"bac.i"|"for.i"|x";end i;call SAVECONFIG
  89. QUI:;if save=1 then do;se "n1caData c6has changed; cbSave c6first? c7[caYesc7]c6: "
  90.   gc;a=result;if a~="N" then do;tr "caYesc6!";signal SAV;end;else tr "cbNoc6.";end;bufferflush;signal MENU
  91. EDITCON:;call READFILE;if hi>total then hi=total
  92. EDITCON0:;tr "f0z4cer1 File List For z0r0cf: cb`ca"nam.file"cb'  cf(cd"total" c6Files c9Totalcf)n1"
  93.   do i=lo to hi;co="d";if i/2=i%2 then co="b";tr "c"co||right(i,2)"cf> c"co||fn.i"";end i
  94.   if hi//15>0 then do;h=hi%15;h=15-(hi-(h*15));do i=1 to h;tr "";end i;end
  95. EDITCON1:;a="cf<caAcf>caddc6, ";a1="cf<cbScf>cbavec6, ce[cdQce]cduitc6.";if total>0 then a=a"cf<c9Kcf>c9illc6, cf<ceEcf>ceditc6, "
  96.   if total>hi then a=a"cf<ccNcf>ccext 15c6, ";if lo>1 then a=a"cf<c7Pcf>c7ast 15c6, ";tr "1Hz4cer1  Commands z0r0cf: "a||a1""
  97. EDITCON2:;se "1Hz4cer1 File List z0r0cf: ";gc;a=result;if a=d2c(13) then a="Q";if index("AKENPSQ",a)=0 then signal EDITCON2
  98.   if a="A" then do;tr "caAdd" ;signal ADD ;end;if a="K" & total>0 then do;tr "c9Kill";signal KILL;end
  99.   if a="E" & total>0 then do;tr "ceEdit";signal EDIT;end;if a="N" & hi~=total then do;tr "ccNext";signal MORE;end
  100.   if a="P" & lo~=1 then do;tr "c7Past";signal LESS;end;if a="S" then do;tr "cbSave";signal SAVE;end
  101.   if a="Q" then do;tr "cdQuit";signal QUIT;end;signal EDITCON2
  102. ADD:;tr "3HcaPathc6/cbFilecf: z0car1"copies(" ",50)"Di"4096" 50}r0";gu 70
  103.   a=result;bad=0;if a="" then do;a="cnet:";tr "14Hz0car1"a"r0";end;do i=1 to total;if fn.i=a then bad=1;end i
  104.   if bad=1 then do;se "14Hc9File is already in this list! cf<cdKeycf>g1";signal EDITCON2;end
  105.   if word(statef(a),1)="DIR" | index(a,"*")>0 then signal ADD2
  106.   if ~exists(a) then do;se "14Hc9File does not exist at given path! cf<cdKeycf>g1"
  107.   signal EDITCON2;end;else total=total+1;save=1;fn.total=a;if total<15 then hi=total;signal EDITCON0
  108. ADD2:;aa=a;c=0;fl=0;z="";z1="";z2="";if index(a,"*")>0 then do;f=lastpos("/",a)
  109.   if f=0 then f=lastpos(":",a);a=left(a,f);z=substr(aa,f+1);z1=right(z,1);z2=left(z,1);end
  110.   if z1="*" & z2~="*" then do;z=strip(z,"t","*");fl=1;end;if z2="*" & z1~="*" then do;z=strip(z,"l","*");fl=2;end
  111.   if z1="*" & z2="*"  then do;fl=3;f1=length(z);f2=f1-2;z=substr(z,2,f2);end
  112.   se "14HcbReadingc6...";d=showdir(a,"f","|");d=d"|xxx";call open(g1,"ram:CNetBackUp.TMP","w");do i=1 until a1="xxx"
  113.   parse var d a1"|"a2;if a1="xxx" then leave i;call writeln(g1,a1);d=a2;end i;call close(g1)
  114.   address command "SORT ram:CNetBackUp.TMP ram:CNetBackUp.TMP";all=0;an.=a;if right(a,1)~=":" & right(a,1)~="/" then an.=a"/"
  115.   l=length(z);z=upper(z);call open(g1,"ram:CNetBackUp.TMP","r");do i=1 until eof(g1);a1=readln(g1);if a1="" then leave i
  116.   if fl=1 & left(upper(a1),l)~=z  then do;d=a2;iterate i;end;if fl=2 & right(upper(a1),l)~=z then do;d=a2;iterate i;end
  117.   if fl=3 & pos(z,upper(a1))=0    then do;d=a2;iterate i;end;if all=1 then addkeys ("A")
  118.   se "13Hc9"right(a1,25)" cf? c6(caYc6/cbnc6/c9ac6/celc6/cdqc6)cf: ";gc;b=result
  119.   if b="Q" then do;tr "cdQuit";leave i;end;if b="N" then do;tr "cbNo" ;end
  120.   if b="A" then do;tr "c9All";all=1;c=c+1;an.c=an.c||a1;save=1;iterate i;end
  121.   if b="L" then do;tr "ceLast";c=c+1;an.c=an.c||a1;save=1;leave i;end
  122.   if index("QNAL",b)=0 then do;tr "caYes";c=c+1;an.c=an.c||a1;save=1;end  
  123. ADD3:;d=a2;end i;call close(g1);address command "DELETE ram:CNetBa#?"
  124.   se "14HcbAdding cafilesc6...";do i=1 to total;do j=1 to c;if fn.i=an.j then an.j="";end j;end i;c2=0
  125.   do i=1 to c;if an.i~="" then do;c2=c2+1;an2.c2=an.i;end;end i;c=c2;do i=1 to c;total=total+1;fn.total=an2.i;end i
  126.   hi=15;if total<15 then hi=total;se "14Hc9"c" cafiles cbaddedc6.w1";signal EDITCON0
  127. KILL:;tot=total;tr "2Hc9Kill c6Whichcf: cai"4096+16384" 20}";gu 70;a=result;if a>"" then call PARSER(a)
  128.   if a="" | totpit=0 then do;tr "14Hc9Abortc6!";signal EDITCON2;end
  129.   do i=1 to totpit;j=it.i;fn.j="";end i;c=0;do i=1 to total;if fn.i>"" then do;c=c+1;f.c=fn.i;end
  130.   end i;do i=1 to c;fn.i=f.i;end i;total=c;save=1;lo=1;hi=15;if hi>total then hi=total;if total=0 then tr "f1";signal EDITCON0
  131. EDIT:;tot=total;tr "2HceEdit c6Whichcf: cai"4096+16384" 20}";gu 70;a=result;if a>"" then call PARSER(a)
  132.   if a="" | totpit=0 then do;tr "14Hc9Abortc6!";signal EDITCON2;end
  133.   do i=1 to totpit;z=it.i;addkeys (fn.z);tr "2H ceEdit c6Filecf: z0car1"copies(" ",50)"Di"4096" 50}r0";gu 70
  134.   b=result;if b="" | exists(b)=0 | word(statef(b),1)="DIR" then do;se "14Hc9File does not exist at given path! cf<cdKeycf>g114H"
  135.   iterate i;end;else do;fn.z=b;save=1;end;end i;if save=0 then signal EDITCON2;else signal EDITCON0
  136. MORE:;lo=lo+15;hi=lo+14;if hi>total then hi=total;signal EDITCON0
  137. LESS:;lo=lo-15;hi=lo+14;if hi>total then hi=total;signal EDITCON0
  138. SAVE:;if qa then signal CREATEARC2 ; if save=1 then call SAVEFILE
  139. QUIT:;if save=1 then do;se "1HcaData c6has changed; cbSave c6first? c7[caYesc7]c6: "
  140.   gc;a=result;if a~="N" then do;tr "caYesc6!";signal SAVE;end;else tr "cbNoc6.";end;bufferflush;signal MENU
  141.  
  142. ADDFILE:
  143.   tr "f0z4cer1  Add BackUp File z0r0cf:n1" ; a=""
  144.   tr "cd    File Extensioncf: z0car1   r0"
  145.   tr "cbBackUp Descriptioncf: z0car1"left(a,50)"r0"
  146.   tr "cd    TEMP/WORK Pathcf: z0car1"left(bdf,50)"r0"
  147.   tr "cb  DESTINATION Pathcf: z0car1"left(a,50)"r0"
  148.   tr "cd  Interval in Dayscf: z0car1   r0"
  149.   tr "cbCreate Directoriescf: z0car1   r0"
  150.   tr "cdArc to Destinationcf: z0car1   r0"
  151.   tr "cb  Format Dest Pathcf: z0car1         r0n1"
  152.   tr "c6Type cd`cbQcd' c6in cdANY c6field to c9Abortc6."
  153.  
  154. ADDFILE0:
  155.   se "1Hz0car1i"1+4096" 3}r0";gu 70;a=result;bad=0
  156.   if a="Q" then signal MENU;if a="CFG" then bad=1;if a="" then a="BAK"
  157.   do i=1 to files;if ext.i=a then bad=1;end i;if bad=1 then do
  158.     tr "5Hc9Invalid, reserved, or already used! cf<cdKeycf>g15H"
  159.   signal ADDFILE0;end;else ext=a;tr "1Hz0car1"a"r0"
  160.  
  161. ADDFILE1:
  162.   se "1Hz0car1i"16+4096" 50}r0";gu 70;a=result;if upper(a)="Q" then signal MENU
  163.   if a="" then a="BackUp File # "files+1;nam=a;tr "1Hz0car1"left(nam,50)"r0"
  164.  
  165. ADDFILE2:
  166.   se "1Hz0car1L1305640 #"bdf"}i"4+4096" 50}r0";gu 70;a=result;if upper(a)="Q" then signal MENU
  167.   if a="" & exists(bdf) then a=bdf;if a="" | word(statef(a),1)~="DIR" then do
  168.   tr "5Hc9Invalid or nonexistent directory! cf<cdKeycf>g15H"
  169.   signal ADDFILE2;end;else tem=a;if right(tem,1)~=":" & right(tem,1)~="/" then do;tem=tem"/";end
  170.   tr "1Hz0car1"left(tem,50)"r0"
  171.  
  172. ADDFILE3:
  173.   if words(drives)>1 & index(drives,"DF1:")>0 then des="DF1:";else des=""
  174.   se "5HcaIf a FLOPPY drive, place diskette IN the drive..."
  175.   se "1Hz0car1L1305640 #"des"}i"1+4+4096" 50}r0";gu 70;a=result
  176.   if upper(a)="Q" then signal MENU;if a="" & drives>"" then a=word(drives,1);z=pragma("w","n")
  177.   if word(statef(a),1)~="DIR" then do;tr "5Hc9Invalid or nonexistent directory! cf<cdKeycf>g15H";z=pragma("w")
  178.   signal ADDFILE3;end;else des=a;if right(des,1)~=":" & right(des,1)~="/" then do;des=des"/";end;tr "1Hz0car1"left(des,4)"r05H"
  179.  
  180. ADDFILE4:
  181.   se "1Hz0car1L1305640 #1}i"4+64+4096" 3}r0";gu 70;a=result;if upper(a)="Q" then signal MENU;if a="" then a=1; if a<1 | a>365 then do
  182.   tr "5Hc9Interval MUST be between 1 and 365 days! cf<cdKeycf>g15H"
  183.   signal ADDFILE4;end;else day=a;tr "1Hz0car1"left(a,3)"r0"
  184.  
  185. ADDFILE5:
  186.   se "5HCreate separate directory structures? [y/N]: ";gc;a=result
  187.   if a="Y" then dir=1 ; else dir=0 ; se word("No Yes",dir+1)
  188.   se "1Hz0car1"left(word("No Yes",dir+1),3)"r0"
  189.  
  190. ADDFILE6:
  191.   if dir=0 then do ; bac=0 ; se "1Hz0car1"left(word("No Yes",bac+1),3)"r0" ; signal ADDFILE7 ; end
  192.   se "5HCreate archive directly in `"des"'? [Y/n]: ";gc;a=result
  193.   if a="N" then bac=1 ; else bac=0 ; se word("No Yes",bac+1)
  194.   se "1Hz0car1"left(word("No Yes",bac+1),3)"r0"
  195.  
  196. ADDFILE7:
  197.   se "30HFormat destination? [y/N]: ";gc;a=result;if a="Q" then signal MENU
  198.   if a~="Y" then do;tr "21Hz0car1No r0";for=0;signal ADDFILE8;end
  199.   if index(" "drives" "," "upper(des)" ")=0 then do
  200.     tr "30Hc9Only when Dest. is one of these> ca"drives" cf<cdKeycf>g130H"
  201.     signal ADDFILE7;end;else do;tr "21Hz0car1Yesr0";for=1;end
  202.   se "30HUse [Q]uick or <F>ull FORMAT? [f/Q]: ";gc;a=result
  203.   if a="F" then tr "21Hz0car1Yes/Full r0"
  204.     else do;tr "21Hz0car1Yes/Quickr0";for=2;end
  205.  
  206. ADDFILE8:
  207.   se "n4If the above is correct, press ENTER to begin entering the file "
  208.   se "information for this BackUp Set, else press "Q" to Quit, without "
  209.   se "adding this listing...";gc;a=result;if a="Q" then signal MENU
  210.   files=files+1 ; se "f1"
  211.   file.files=tim"|"ext"|"nam"|"tem"|"des"|"day"|"dir"|"bac"|"for"|x"
  212.   call SAVECONFIG ; file=files ; lo=1 ; hi=15 ; save=1 
  213.  signal EDITCON
  214.  
  215. KILLFILE:;if files=0 then do;se "n1c9No BackUp Files Created to Kill! cf<cdKeycf>g1";signal MENU;end;else call PICK("Kill")
  216.   se "n1c6Really c9KILL cb`ca"nam.a"cb'c6? c7[cbNoc7]c6: ";gc;b=result;if b~="Y" then do;tr "cbNoc6.";signal MENU;end;else tr "caYesc6!"
  217.   if exists(df"cnetbackup."ext.a) then address command 'DELETE "'df'CNetBackUp.'ext.a'"'
  218.   file.a="";do i=1 to files;j=i+1;if file.i="" then do;file.i=file.j;file.j="";end;end i;files=files-1;call SAVECONFIG;signal MENU
  219.  
  220. LOGVIEW:
  221.   if ~exists("SysData:Log/CNetBackUp_"ext.file) then do
  222.     se "n1c6There is c9NO cb`caCNetBackUp_"ext.file"cb' c6log in cb`caSysData:Log/cb'c6... cf<cdKeycf>g1"
  223.     signal MENU ; end ; tr "*0SysData:Log/CNetBackUp_"ext.file"}cf<cdKeycf>g1" ; signal MENU
  224.  
  225. CREATEARC:
  226.   se "n1    caFilename c6for this archive? cf[caCNBarccf]c6: caI0 15}";gu 70;a=result;if a="" then a="CNBarc"
  227.   if upper(right(a,4))~=".LHA" then a=a".LHA";fn2=a
  228.   se "caCreate c6archive in which path? cf[caPROGDIRcf]c6: caI0 40}";gu 70;a=result
  229.   if a="" | word(statef(a),1)~="DIR" then a=df;df2=a
  230.   se "n1c6Use cb`ca"df2||fn2"cb' c6as the cbPath/Filenamec6? cf[caYescf]c6: ";gc;a=result
  231.   if a="N" then do;tr "c9No";signal MENU;end;else do;tr "caYesf1";pf=df2||fn2;end
  232.   lo=1;hi=15;file=0;nam.file=fn2;qa=1;signal EDITCON
  233. CREATEARC2:
  234.   if total=0 then do;se "c9No files selected! cf<ceKeycf>g1";signal MENU;end;tr "f1cbCreate Archivecen1"
  235.   if exists(pf) then do
  236.     se "c6A cb`ca"pf"cb' c6archive cdalready existsc6.n2cf<c9Dcf>c9elete c6or cf<cbRcf>cbenamec6? cf[c9DELETEcf]c6: ";gc;a=result
  237.     if a~="R" then do;tr "c9Delete";address command "delete "pf;end
  238.     else do;aa=left(fn2,length(fn2)-4)date("s")".LHA"
  239.       se "cbRenamen2c6Enter canew c6filename? cf[ca"aa"cf]c6: caI0 40}";gu 70;a=result
  240.       if upper(right(a,4))~=".LHA" then a=a".LHA"
  241.       if a="" | a=".LHA" then a=aa
  242.       address command 'rename "'pf'" "'df2||a'"';end;end
  243.   fi.="";fi=1;do i=1 to total
  244.     if length(pf||fi.fi||fn.i)+26<=150 then fi.fi=fi.fi" "fn.i
  245.       else do;fi=fi+1;fi.fi=fi.fi" "fn.i;end;end i
  246.   tr "n1c6Creating cb`ca"pf"cb' c6archive...n1ce"
  247.   do i=1 to fi ; tr "#4LHA -r -e -x -2 -D2 a "pf" "fi.i"}" ; end i
  248.   tr "n1c6Testing c9integrity c6of cb`ca"pf"cb' c6archive...n1ce"
  249.   se "#4LHA t "pf"}"
  250.   tr "n1c6The cb`ca"pf"cb' c6archive was created!n1"
  251.   se "cbSend c6this archive to which user? cf[c9ABORTcf]c6: cbI0 30}";gu 70;a=result
  252.   if a="" then do;tr "c9Abortc6!";exit;end ; if datatype(a,"n")=0 then do;findaccount a;a=result;end
  253.   loadscratch a;savescratch (-a);st=result;getscratch 1;han=result
  254.   if a=0 | st=0 | han="!" then do;tr "c9Invalid User Accountc6!";exit;end
  255.   se "n1c6Sending cb`ca"pf"cb' c6archive to cd"han" cf(c6ID#cd"a"cf) c6now...n1"
  256.   addkeys "MS`"a"```"fn2"`f`"pf"`Here are the files you requested!`.s`"
  257.  exit
  258.  
  259. FLOPPY:;drives="";do i=0 to 9;if showlist("W","DF"i) then drives=drives"DF"i": ";end i;drives=strip(drives);call SAVECONFIG;return
  260. BACKUP:;if files=0 then do;se "n1c9No BackUp Files to BackUp! cf<cdKeycf>g1";signal MENU;end;else call PICK("BackUp")
  261.   se "n1ceBackUp c6using cb`ca"nam.a"cb' c6File? c7[caYesc7]c6: ";gc;b=result;if b="N" then do;tr "cbNoc6.";signal MENU;end
  262.   tr "caYesc6!";file=a;call READFILE;if total=0 then do
  263.   se "n1c9The cb"nam.a" c9BackUp File is EMPTY! cf<cdKeycf>g1";signal MENU;end
  264.   tem=tem.file;des=des.file;bname="CNetBackUp_"ext.a".LHA"
  265.   tr "f1n1z4cer1 Backing Up CNet Using `"nam.a"' File z0r0n1"
  266.   do until aa=1;z=pragma("w","n");aa=exists(des);z=pragma("w")
  267.   if aa=0 then se "cbInsert c6a disk into ca"des" c6and cdhit any keyc6...g1n1";end
  268.   if exists(des||bname) then do;address command 'PROTECT "'des||bname'" d'
  269.     address command 'DELETE "'des||bname'"';end
  270.   mi=0;miF.=0;fi=1;fi.=""
  271.   do i=1 to total;fn=fn.i;tr "cf[z0car1 Testing File r0cf> ca"fn
  272.     if ~exists(fn) then do;tr "cf[z5cb Missing File z0cf> cd"fn
  273.       mi=mi+1;mi.mi=fn;miF.i=1;iterate i;end
  274.     if dir.a then do
  275.       f1=pos(":",fn);d1=left(fn,f1-1);fn=substr(fn,f1+1)
  276.       if ~exists(tem||d1) then do
  277.         tr "cf[z0c9r1 Creating Dir r0cf> c9"d1
  278.         address command 'MAKEDIR "'tem||d1'"';end
  279.       do j=1 until f1=0;f1=pos("/",fn)
  280.         if f1>0 then do;d1=d1"/"left(fn,f1-1);fn=substr(fn,f1+1);end
  281.         if ~exists(tem||d1) then do
  282.           tr "cf[z0c9r1 Creating Dir r0cf> c9"d1
  283.           address command 'MAKEDIR "'tem||d1'"';end
  284.       end j;tr "cf[z0cbr1 Copying File r0cf> cb"fn.i
  285.       address command 'COPY "'fn.i'" "'tem||d1'/'fn'"';end
  286.     else do
  287.       if length(tem||bname||fi.fi||fn)+26<=150 then fi.fi=fi.fi" "fn
  288.       else do;fi=fi+1;fi.fi=fi.fi" "fn;end;end
  289.   end i;file.file=overlay(tim,file.file,1);call SAVECONFIG
  290.   if for.file>0 then do
  291.     tr "cf[z0ccr1 Formatting.. r0cf> cc"des"  cf(cc"word("FULL QUICK",for.file)"cf)"
  292.     form="";if for.file=2 then form="QUICK";do until a=1;z=pragma("w","n");a=exists(des);z=pragma("w")
  293.     if a=0 then se "cbInsert c6a disk into ca"des" c6and cdhit any keyc6...g1n1";end
  294.     tr "#4FORMAT <nil: drive "des" name CNetBackUps NOICONS "form" FFS}"
  295.   end
  296.   tr "cf[z0cer1 Packing File r0cf> ce"bname"n1"
  297.   temp=tem;if bac.file then temp=des.file
  298.   if dir.file then tr "#4LHA -a -r -e -x -2 -D2 a "temp||bname" "tem"#?}"
  299.   else do;do i=1 to fi
  300.       tr "#4LHA -a -r -e -x -2 -D2 a "temp||bname" "fi.i"}"
  301.     end i;end
  302.   if ~bac.file then do
  303.     tr "cf[z0cdr1 Copying File r0cf> cd"bname
  304.     address command 'COPY "'tem||bname'" "'des||bname'"'
  305.   end
  306.   d=date("s");da=left(date("w",d,"s"),3)"., "date("m",d,"s")" "strip(substr(d,7,2),"l","0")", "left(d,4)" @ "time("c")
  307.   com="CNet Amiga BackUp, "ver" Created on "da;address command 'FILENOTE "'des||bname'" "'com'"'
  308.   address command 'PROTECT "'des||bname'" re'
  309.   if dir.file then do ; tem=tem.file
  310.     tr "cf[z0c6r1 Cleaning Up! r0cf> c6"tem
  311.     address command "DELETE "tem"#? ALL";end
  312.   log=left(bname,length(bname)-4)
  313.   se "#4LHA t >sysdata:log/"log" "des||bname"}"
  314.   call open(f1,"sysdata:log/"log,"a");call writeln(f1,"");call writeln(f1,com);call close(f1)
  315.   tr "c9Log c6Filecf: cb`caSysData:Log/"log"cb'cen1*0sysdata:log/"log"}"
  316.   if mi>0 then do
  317.     tr "c6The following files were cfMISSING c6and were c9NOT c6just backed up:n1"
  318.     do i=1 to mi ; tr "  c"substr("db",(i/2=i%2)+1,1)mi.i ; end i ; end
  319.   se "n1cbCompletedc6... Press cdAny Key c6Now...g1";signal BEGIN
  320.  
  321. SAVECONFIG:;call open(f1,cfg,"w");call writeln(f1,files);do i=1 to files;call writeln(f1,file.i);end i;call writeln(f1,drives);call close(f1);save=0
  322.  
  323. READCONFIG:;call open(f1,cfg,"r");files=readln(f1);do i=1 to files;file.i=readln(f1)
  324.   parse var file.i tim.i"|"ext.i"|"nam.i"|"tem.i"|"des.i"|"day.i"|"dir.i"|"bac.i"|"for.i"|"j;end i;drives=readln(f1);call close(f1);return
  325.  
  326. SAVEFILE:
  327.   if total=0 then do
  328.     if exists(fn||ext.file) then address command 'DELETE "'fn||ext.file'"'
  329.     total=0;save=0;return;end
  330.   call open(f1,fn||ext.file,"w");do i=1 to total;call writeln(f1,fn.i);end i;call close(f1);save=0
  331.   address command 'SORT "'fn||ext.file'" "'fn||ext.file'"'
  332.  
  333. READFILE:;if ~exists(fn||ext.file) then do;total=0;return;end;call open(f1,fn||ext.file,"r")
  334.   do i=1 until eof(f1);fn.i=readln(f1);end i;call close(f1);total=i-1;return
  335.  
  336. PARSER:;parse arg r;rr="";do ii=1 to length(r);a=substr(r,ii,1);if index("0123456789-,",a)=0 then iterate ii;rr=rr||a;end ii;r=rr;a=pos(",",r);ii=0;jj=0
  337.   if a>0 then do;do ii=1 until pos(",",r)=0;a=pos(",",r);v.ii=left(r,a-1);r=substr(r,a+1);end ii;ii=ii+1;v.ii=r;r1=ii;end;else do;r1=1;v.1=r;end
  338.   do ii=1 to r1;a=pos("-",v.ii);if right(v.ii,1)="-" then v.ii=v.ii||tot;if left(v.ii,1)="-" then do;v.ii="1"v.ii;a=a+1;end;if a=0 then do;jj=jj+1;it.jj=v.ii;iterate ii;end
  339.   l1=left(v.ii,a-1);l2=substr(v.ii,a+1);low=min(l1,l2);high=max(l1,l2);do k=low to high;jj=jj+1;it.jj=k;end k;end ii;totpit=jj;return
  340. QUITBYE:;setobject more;putuser 1100454;bufferflush;logentry "CNet BackUp Used.";exit
  341.  
  342. SYNTAX:;ERROR:;IOERR:;e1="n1 Error: "rc" ("errortext(rc)")"
  343.   e2="  Line: "left(sigl,4)"File:";gu 1311992;a=result;gu 1311960
  344.   b=result;c="`"a||b", "ver"'";e2=e2" "c;tr e1;tr e2;logentry e1
  345.   logentry e2;e=strip(translate(sourceline(sigl),"\{",""));do while e~=""
  346.   e3="Source: "left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush
  347. /**************************************************************************\
  348. \****************************************** Frontiers BBS (716)/823-9892 **/
  349.